package org.rea.logic;

import java.util.ArrayList;
import java.util.List;



public class MyList<T>{
	
	private List<T> list = new ArrayList<T>();
	private int length = 0;
	
	
	public void addElement(T ob){
		length++;
		list.add(ob);
	}
	
	public int lenght(){
		return this.length;
	}

	public int last(){
		return this.length-1;
	}
	
	public T getElement(int pos){
		return list.get(pos);
	}
	
	public MyIterator<T> getForwardIterator(){
		return new MyForwardIterator<T>(this);
	}
	
	public MyIterator<T> getBackwardIterator(){
		return new MyBackwardIterator<T>(this);
	}
	
}
